/*
 ============================================================================
 Name		: MyControl.h
 Author	  : William Zhang
 Version	 : 1.0
 Copyright   : all rights reserved.
 Description : CMyControl declaration
 ============================================================================
 */

#ifndef MYCONTROL_H
#define MYCONTROL_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <coecntrl.h>
#include <eiklabel.h>

// CLASS DECLARATION

/**
 *  CMyControl
 * 
 */
class CMyControl : public CCoeControl
	{
public:
	// Constructors and destructor

	/**
	 * Destructor.
	 */
	~CMyControl();

	/**
	 * Two-phased constructor.
	 */
	static CMyControl* NewL(const TRect& aRect,const CCoeControl* aParent);

	/**
	 * Two-phased constructor.
	 */
	static CMyControl* NewLC(const TRect& aRect,const CCoeControl* aParent);

private:	
	
	/**
	 * Constructor for performing 1st stage construction
	 */
	CMyControl();

	/**
	 * EPOC default constructor for performing 2nd stage construction
	 */
	void ConstructL(const TRect& aRect,const CCoeControl* aParent);

	
private:
	//from CCoeControl
	void SizeChanged();
	
	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
	
	void Draw(const TRect& aRect) const;
	
	TSize MinimumSize();
private:
	CEikLabel* iLabel;
	};

#endif // MYCONTROL_H
